package cn.cdu.medical.entity;

import cn.cdu.basics.baseClass.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Column;
import java.util.Date;

@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "prescription")
@TableName("prescription")
@Schema(description = "处方信息")
@EqualsAndHashCode(callSuper = true)
public class Prescription extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @Schema(description = "病历ID")
    private String medicalRecordId;

    @Schema(description = "患者ID")
    private String patientId;

    @Schema(description = "医生ID")
    private String doctorId;

    @Schema(description = "处方编号")
    private String prescriptionNo;

    @Schema(description = "处方类型")
    private String prescriptionType;

    @Schema(description = "处方状态")
    private String status;

    @Schema(description = "用药说明")
    @Column(columnDefinition = "TEXT")
    private String instructions;

    @Schema(description = "处方备注")
    @Column(columnDefinition = "TEXT")
    private String notes;

    @Schema(description = "有效期开始时间")
    private Date validityStartTime;

    @Schema(description = "有效期结束时间")
    private Date validityEndTime;
} 